﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    
        xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    
        xmlns:view="clr-namespace:CaliburnWpf.Views"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" x:Class="CaliburnWpf.Views.ShellView"
    
    xmlns:helper="clr-namespace:CaliburnWpf.Views.Infrastructure"
        Title="MainWindow" Height="350" Width="525"
    xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
        >
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>

        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <ToolBarPanel HorizontalAlignment="Stretch" Grid.ColumnSpan="2" Name="toolBarPanel1"  >
            <ToolBar >
                <ToolBar.Resources>
                    <Style TargetType="Image">
                        <Setter Property="Width" Value="32"/>
                        <Setter Property="Height" Value="32"/>
                    </Style>
                </ToolBar.Resources>
                <Button Command="{Binding CreateAccountCommand}" ToolTip="Create account" >
                    <Image Source="/Resources/newacct.png" />
                </Button>
                <Button x:Name="ManageCategories" ToolTip="Manage categories">
                    <Image Source="/Resources/categoryedit.png" />
                </Button>
                <Button x:Name="ManageContragents">
                    <Image Source="/Resources/payees.png" />
                </Button>
                <Menu>
                    <MenuItem Header="relocate">
                        <MenuItem Header="Category" Command="{Binding Path=RelocateByCategoryCommand}"/>
                        <MenuItem Header="Payer" Command="{Binding Path=RelocateByContargentCommand}" />
                    </MenuItem>
                </Menu>

                <ListBox Margin="0,5"  Background="{x:Null}" BorderBrush="Orange" BorderThickness="1"   ItemsSource="{Binding Path=SelectedPath,Mode=OneWay}" MinWidth="300" HorizontalAlignment="Stretch" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Name}"/>
                                <TextBlock Text= " > "/>

                                <!--<ComboBox ItemsSource="{Binding ItemsView}"/>-->

                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal">

                            </StackPanel>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
            </ToolBar>



        </ToolBarPanel>

        <Border BorderThickness="2,1,1,1"  Grid.Row="1" BorderBrush="#FFBBBBBB"  >


            <TreeView   helper:ViewHelper.SelectedPath="{Binding Path=SelectedPath,Mode=OneWayToSource,diagnostics:PresentationTraceSources.TraceLevel=High}" 
			x:Name="tree"   ItemsSource="{Binding ItemsView}"   TreeViewItem.Selected="OnItemSelected" >
                <TreeView.Resources>

                </TreeView.Resources>
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate  ItemsSource="{Binding ItemsView}" >
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Name}"/>
                        </StackPanel>
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>
            
        </Border>



        <GridSplitter Grid.Row="1" Grid.Column="1"  Background="#88A0A0A0" RenderTransformOrigin="0.5,0.5"  HorizontalAlignment="Left" Name="gridSplitter1" VerticalAlignment="Stretch" Width="10" Margin="-5,30,0,30"  ShowsPreview="True" Panel.ZIndex="1000">


        </GridSplitter>

        <ContentControl Margin="10" cal:View.Model="{Binding Selected}"  Grid.Column="1" Grid.Row="1" ></ContentControl>

    </Grid>

</Window>